module.exports = {
  apps: [{
    name: 'custom-checkin-server',
    script: 'dist/index.js',
    listen_timeout: 15000,
    instances: '2',
    autorestart: false,
    // watch: ['controller', 'middleware', 'prototype', 'routes', 'app.js'],
    // Delay between restart
    // watch_delay: 1000,
    // ignore_watch: ['node_modules', 'logs', 'models', 'public', 'html', 'yarn.lock'],
    exec_mode: 'cluster',
    max_memory_restart: '4G',
    output: 'logs/out.log',
    error: 'logs/error.log',
    log_date_format: 'YYYY-MM-DD HH:mm:ss.SSS',
    env: {
      NODE_ENV: 'development'
    },
    env_production: {
      NODE_ENV: 'production'
    }
  }],
  deploy: {
    production: {
      user: 'app',
      host: ['8.136.104.146'],
      port: '22',
      ref: 'origin/master',
      repo: 'git@gitee.com:chinawuyi/npa-server.git',
      path: '/home/app/core/npa-server',
      ssh_options: 'StrictHostKeyChecking=no',
      'post-deploy': 'NODE_ENV=production yarn install --production && pm2 reload ecosystem.config.js --env production'
    }
  }
};
